<template>
  <div class="overhaul-workList">
    <el-tabs v-model="tabActive" type="card" @tab-click="tabClick">
      <!-- 专业 -->
      <template v-for="(item,index) in formData">
        <el-tab-pane :label="getmajorName(item.major)" :key="index">
          <div class="tableConten w100">
            <div class="itemTitle">作业表单：</div>
            <div class="tebleDiv">
              <div class="tebleDiv-top">
                <el-collapse
                  v-model="item.collapseActive"
                  accordion
                  @change="(val)=>handleChange(val,item)"
                >
                  <!-- 专业下表单 -->
                  <template v-for="(formItem,formIndex) in item.forms">
                    <el-collapse-item :key="formIndex" :name="formIndex">
                      <template slot="title">
                        <div class="collapseTitle">
                          <span class="collapseLeft">
                            <span class="lable">表单名{{formIndex+1}}：</span>
                            <span class="formName" @click.stop>
                              <el-input v-model="formItem.name" placeholder="请输入表单名"></el-input>
                            </span>
                            <!-- <span class="lable">{{formItem.code}}</span> -->
                          </span>
                          <span class="collapseRight">
                            <el-button
                              class="moveBtn el-button el-button--primary el-button--mini"
                              size="mini"
                              v-if="!disabled"
                              @click.stop="removeItem(formItem,formIndex,index)"
                            >移除</el-button>
                            <el-button
                              v-if="formIndex!=0"
                              class="moveBtn el-button el-button--primary el-button--mini"
                              size="mini"
                              icon="el-icon-top"
                              title="上移"
                              @click.stop="moveItem(formItem,formIndex,index,'up')"
                            ></el-button>
                            <el-button
                              v-if="formIndex < item.forms.length-1"
                              class="moveBtn el-button el-button--primary el-button--mini"
                              size="mini"
                              icon="el-icon-bottom"
                              @click.stop="moveItem(formItem,formIndex,index,'down')"
                              title="下移"
                            ></el-button>
                          </span>
                        </div>
                      </template>
                      <!-- <workListItem></workListItem> -->
                      <editTableNew
                        :tableSetting="workListDetails"
                        :tableData="formItem.overhaulReadies"
                        @handleClickAdd="addWorkList"
                        :hideBtn="disabled"
                        :ref="'workListTable_'+index+'_'+formIndex"
                      >
                        <template #itemLable="{ editFormInfo }">
                          <el-form
                            :model="itemLable"
                            ref="ruleForm"
                            label-width="100px"
                            class="demo-ruleForm"
                          >
                            <template v-for="(item,index) in editFormInfo.itemLable">
                              <el-form-item
                                :label="item.name+'('+item.unit+'):'"
                                prop="name"
                                :key="index"
                              >
                                <el-input v-model="item.value" @change="val=>inputChange(val,item)"></el-input>
                              </el-form-item>
                            </template>
                          </el-form>
                        </template>
                      </editTableNew>
                      <testTable
                        style="margin-top: 20px"
                        :data="formItem.itemDTOs"
                        :isEditTable="isEditTable"
                        :hideBtn="hideBtn"
                        :ref="'workProcessTable_'+index+'_'+formIndex"
                      />
                    </el-collapse-item>
                  </template>
                </el-collapse>
              </div>
              <div class="tebleDiv-bottom">
                <el-button
                  class="el-button el-button--primary el-button--mini"
                  size="mini"
                  v-if="!disabled"
                  @click="addWorlkForm(index)"
                  icon="el-icon-plus"
                >添加作业表单</el-button>
              </div>
            </div>
          </div>

          <div class="tableConten">
            <div class="itemTitle">作业指导书:</div>
            <div class="tebleDiv">
              <el-button
                class="el-button el-button--primary el-button--mini"
                size="mini"
                v-if="!disabled"
                @click="chooseBook"
              >关联</el-button>
              <div class="bookContent" v-if="showBookList(item)">
                <template v-for="(nookItem,nookIndex) in item.instructions">
                  <div class="line" :key="nookIndex">
                    <span>{{nookItem.instructionName}}</span>
                    <span class="leftBtn">
                      <el-button
                        type="text"
                        size="mini"
                        icon="el-icon-zoom-in"
                        @click="getBookFile(nookItem,'preview')"
                        title="预览"
                      ></el-button>
                      <el-button
                        type="text"
                        size="mini"
                        icon="el-icon-download"
                        @click="getBookFile(nookItem,'download')"
                        title="下载"
                      ></el-button>
                      <el-button
                        type="text"
                        size="mini"
                        icon="el-icon-delete"
                        @click="deletBook(nookItem,item,index)"
                        title="删除"
                      ></el-button>
                    </span>
                  </div>
                </template>
              </div>
            </div>
          </div>
        </el-tab-pane>
      </template>
    </el-tabs>
    <dialogPublic
      :title="'选择标准'"
      :show.sync="showStandard"
      @doSubmit="selectStandard"
      @doClose="() => (showStandard = false)"
    >
      <standardRelatedPage :typeId="typeId" v-if="showStandard" ref="standardRelatedPage" />
    </dialogPublic>
    <dialogPublic
      :title="'指导书'"
      @doSubmit="selectBook"
      @doClose="() => (showStandard = false)"
      :show.sync="showBookDialog"
      appendTobody
      fullscreen
    >
      <instructor pageType="order" ref="bookList"></instructor>
    </dialogPublic>
  </div>
</template>
<script>
import standardRelatedPage from "@/views/standardManagement/operateStandard/normalMaintenanceStandard/StandardRelatedPage.vue";

// import testTable from "./test.vue";
import testTable from "@/views/standardManagement/operateStandard/normalMaintenanceStandard/test.vue";
import instructor from "@/views/standardManagement/workInstructionLibrary/index"; /* 知道书 */
import attachFormNew from "@/components/attach/attachFormNew";
import workListItem from "./workListItem";
import { getAttachList } from "@/api/common";
export default {
  props: {
    currentDept: {
      type: Object,
      default: () => {
        return {};
      }
    },
    formData: {
      type: Array,
      default: () => {
        return [];
      }
    },
    //是否可编辑
    disabled: {
      type: Boolean,
      default: false
    },
    status: {
      type: String,
      default: null
    }
  },
  components: { standardRelatedPage, instructor, testTable },
  watch: {
    currentDept: {
      handler(val) {
        this.otherInfo.parentCode = val.id;
      },
      deep: true
    },
    formData: {
      handler(val) {
        let arr = [];
        this.formData.map(i => {
          arr.push(i.major);
        });
        this.majorArr = arr;
        this.currentMajor = this.formData[0];
      },
      deep: true
    },
    disabled: {
      handler(val) {}
    }
  },
  data() {
    return {
      // formData: {},
      showBookDialog: false,
      tabActive: "0",
      formTitle: "", //新增作业表单的名称
      tableConfig: {
        tableData: []
      },
      currentMajor: {}, //当前专业
      majorArr: [],
      isEditTable: true,
      collapseActive: ["1"],
      orgMemberSelect: {
        seleteType: "device",
        radio: true,
        props: {
          label: "name",
          children: "children"
        },
        column: [
          {
            label: "设备名称",
            prop: "name"
          }
        ],
        chosedData: []
      },
      otherInfo: {},
      showStandard: false,
      currentLineDevice: {},
      currentRow: null,
      typeId: null,

      hideBtn: false,
      workListData: [],
      itemLable: {},
      rules: [],
      workProcessData: [],
      /* 作业表单-作业准备 */
      workListDetails: {
        btnArr: ["add", "edit"],
        column: [
          {
            label: "类别",
            textAlign: "center",
            type: "text",
            prop: "type",
            required: true
          },
          {
            label: "名称",
            textAlign: "center",
            prop: "tools",
            type: "textarea",
            autosize: true,
            required: true
          }
        ],
        title: "作业准备:",
        data: [],
        select: false,
        maxHeight: "100%",
        buttonArr: [
          {
            name: "删除",
            isShow: row => {
              return true;
            },
            methods: (row, index) => {
              this.deletRow(row, index);
            }
          }
        ],
        data: [],
        column: [
          {
            label: "类别",
            textAlign: "center",
            type: "text",
            prop: "type",
            required: true
          },
          {
            label: "名称",
            textAlign: "center",
            prop: "tools",
            type: "textarea",
            autosize: true,
            required: true
          }
        ]
      },
      //附件设置
      attachSetting: {
        businessId: "", //单据的ID
        businessType: "workList"
      }
    };
  },
  computed: {},
  created() {},
  mounted() {
    this.init();
  },
  methods: {
    init() {
      // this.formData = [
      //   {
      //     id: "74F9905D98E649378D74C075E7DF61D8",
      //     overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //     major: "machine",
      //     majorName: "机械11",
      //     sort: 1,
      //     index: 0,
      //     createTime: "2021-10-22 09:50:57",
      //     forms: [
      //       {
      //         id: "058B3C1F03654CE3A970E0F8CF8D635D",
      //         overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //         majorId: "74F9905D98E649378D74C075E7DF61D8",
      //         name: "莲湖泵站机组中心调整",
      //         code: "DXBZ-2021001",
      //         standardId: null,
      //         jober: null,
      //         joberName: null,
      //         safeMan: null,
      //         safeManName: null,
      //         startTime: null,
      //         endTime: null,
      //         sort: 1,
      //         index: 0,
      //         createTime: "2021-10-22 09:50:57",
      //         overhaulReadies: [
      //           {
      //             id: "1AA87EEF52AA4D0692880BED2E61D95B",
      //             overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //             majorId: "74F9905D98E649378D74C075E7DF61D8",
      //             formId: "058B3C1F03654CE3A970E0F8CF8D635D",
      //             type: "1111",
      //             tools: "1111",
      //             result: null,
      //             sort: 1,
      //             createTime: "2021-10-22 09:50:57"
      //           }
      //         ],
      //         itemDTOs: [
      //           {
      //             id: "155E257589DF49638DF5605B25A4CE5A",
      //             overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //             majorId: "74F9905D98E649378D74C075E7DF61D8",
      //             formId: "058B3C1F03654CE3A970E0F8CF8D635D",
      //             standardItemId: null,
      //             parentId: null,
      //             context: "22",
      //             contextStandard: "22",
      //             risk: "222",
      //             level: 1,
      //             result: null,
      //             desc: null,
      //             sort: 2,
      //             createTime: "2021-10-22 09:50:57",
      //             createBy: "krzhoujun",
      //             createByName: "周俊",
      //             updateBy: "krzhoujun",
      //             updateByName: "周俊",
      //             updateTime: "2021-10-22 09:50:57",
      //             itemParams: []
      //           },
      //           {
      //             id: "F5B53A3067384A2B890DA31E3BBD58F6",
      //             overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //             majorId: "74F9905D98E649378D74C075E7DF61D8",
      //             formId: "058B3C1F03654CE3A970E0F8CF8D635D",
      //             standardItemId: null,
      //             parentId: null,
      //             context: "111",
      //             contextStandard: "111",
      //             risk: "111",
      //             level: 1,
      //             result: null,
      //             desc: null,
      //             sort: 1,
      //             createTime: "2021-10-22 09:50:57",
      //             createBy: "krzhoujun",
      //             createByName: "周俊",
      //             updateBy: "krzhoujun",
      //             updateByName: "周俊",
      //             updateTime: "2021-10-22 09:50:57",
      //             itemParams: []
      //           }
      //         ],
      //         formWorkers: []
      //       },
      //       {
      //         id: "F6864AA761B1453BA1B499711C2510E5",
      //         overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //         majorId: "74F9905D98E649378D74C075E7DF61D8",
      //         name: "11莲湖泵站机组中心调整",
      //         code: "DX20210922001",
      //         standardId: "1440589512475529217",
      //         jober: "caotingwang",
      //         joberName: "曹庭旺",
      //         safeMan: "caotingwang",
      //         safeManName: "曹庭旺",
      //         startTime: "2021-10-22 15:44",
      //         endTime: "2021-10-23 15:44",
      //         sort: 2,
      //         index: 1,
      //         createTime: "2021-10-22 09:50:57",
      //         overhaulReadies: [
      //           {
      //             id: "E27A0073613449D2BC7A63B64CB4C196",
      //             overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //             majorId: "74F9905D98E649378D74C075E7DF61D8",
      //             formId: "F6864AA761B1453BA1B499711C2510E5",
      //             type: "1111",
      //             tools: "1111",
      //             result: null,
      //             sort: 1,
      //             createTime: "2021-10-22 09:50:57"
      //           }
      //         ],
      //         itemDTOs: [
      //           {
      //             id: "0EE418A51F134DE4BCD34A32CA462903",
      //             overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //             majorId: "74F9905D98E649378D74C075E7DF61D8",
      //             formId: "F6864AA761B1453BA1B499711C2510E5",
      //             standardItemId: "1439142662258122754",
      //             parentId: null,
      //             context: "33333",
      //             contextStandard: "44444",
      //             risk: "2",
      //             level: 2,
      //             result: true,
      //             desc: "11描述6666",
      //             sort: 1,
      //             createTime: "2021-10-22 09:50:57",
      //             createBy: "krzhoujun",
      //             createByName: "周俊",
      //             updateBy: "krzhoujun",
      //             updateByName: "周俊",
      //             updateTime: "2021-10-22 09:50:57",
      //             itemParams: []
      //           }
      //         ],
      //         formWorkers: []
      //       }
      //     ],
      //     instructions: [],
      //     executes: null
      //   },
      //   {
      //     id: "74F9905D98E649378D74C075E7DF61D8",
      //     overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //     major: "machine",
      //     majorName: "机械22",
      //     sort: 2,
      //     index: 1,
      //     createTime: "2021-10-22 09:50:57",
      //     forms: [
      //       {
      //         id: "058B3C1F03654CE3A970E0F8CF8D635D",
      //         overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //         majorId: "74F9905D98E649378D74C075E7DF61D8",
      //         name: "22莲湖泵站机组中心调整",
      //         code: "DXBZ-2021001",
      //         standardId: null,
      //         jober: null,
      //         joberName: null,
      //         safeMan: null,
      //         safeManName: null,
      //         startTime: null,
      //         endTime: null,
      //         sort: 1,
      //         index: 0,
      //         createTime: "2021-10-22 09:50:57",
      //         overhaulReadies: [
      //           {
      //             id: "1AA87EEF52AA4D0692880BED2E61D95B",
      //             overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //             majorId: "74F9905D98E649378D74C075E7DF61D8",
      //             formId: "058B3C1F03654CE3A970E0F8CF8D635D",
      //             type: "1111",
      //             tools: "1111",
      //             result: null,
      //             sort: 1,
      //             createTime: "2021-10-22 09:50:57"
      //           }
      //         ],
      //         itemDTOs: [
      //           {
      //             id: "155E257589DF49638DF5605B25A4CE5A",
      //             overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //             majorId: "74F9905D98E649378D74C075E7DF61D8",
      //             formId: "058B3C1F03654CE3A970E0F8CF8D635D",
      //             standardItemId: null,
      //             parentId: null,
      //             context: "22",
      //             contextStandard: "22",
      //             risk: "222",
      //             level: 1,
      //             result: null,
      //             desc: null,
      //             sort: 2,
      //             createTime: "2021-10-22 09:50:57",
      //             createBy: "krzhoujun",
      //             createByName: "周俊",
      //             updateBy: "krzhoujun",
      //             updateByName: "周俊",
      //             updateTime: "2021-10-22 09:50:57",
      //             itemParams: []
      //           },
      //           {
      //             id: "F5B53A3067384A2B890DA31E3BBD58F6",
      //             overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //             majorId: "74F9905D98E649378D74C075E7DF61D8",
      //             formId: "058B3C1F03654CE3A970E0F8CF8D635D",
      //             standardItemId: null,
      //             parentId: null,
      //             context: "111",
      //             contextStandard: "111",
      //             risk: "111",
      //             level: 1,
      //             result: null,
      //             desc: null,
      //             sort: 1,
      //             createTime: "2021-10-22 09:50:57",
      //             createBy: "krzhoujun",
      //             createByName: "周俊",
      //             updateBy: "krzhoujun",
      //             updateByName: "周俊",
      //             updateTime: "2021-10-22 09:50:57",
      //             itemParams: []
      //           }
      //         ],
      //         formWorkers: []
      //       },
      //       {
      //         id: "F6864AA761B1453BA1B499711C2510E5",
      //         overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //         majorId: "74F9905D98E649378D74C075E7DF61D8",
      //         name: "22莲湖泵站机组中心调整",
      //         code: "DX20210922001",
      //         standardId: "1440589512475529217",
      //         jober: "caotingwang",
      //         joberName: "曹庭旺",
      //         safeMan: "caotingwang",
      //         safeManName: "曹庭旺",
      //         startTime: "2021-10-22 15:44",
      //         endTime: "2021-10-23 15:44",
      //         sort: 2,
      //         index: 1,
      //         createTime: "2021-10-22 09:50:57",
      //         overhaulReadies: [
      //           {
      //             id: "E27A0073613449D2BC7A63B64CB4C196",
      //             overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //             majorId: "74F9905D98E649378D74C075E7DF61D8",
      //             formId: "F6864AA761B1453BA1B499711C2510E5",
      //             type: "1111",
      //             tools: "1111",
      //             result: null,
      //             sort: 1,
      //             createTime: "2021-10-22 09:50:57"
      //           }
      //         ],
      //         itemDTOs: [
      //           {
      //             id: "0EE418A51F134DE4BCD34A32CA462903",
      //             overhaulId: "67C2C117F328426B9A3A44825362BF5A",
      //             majorId: "74F9905D98E649378D74C075E7DF61D8",
      //             formId: "F6864AA761B1453BA1B499711C2510E5",
      //             standardItemId: "1439142662258122754",
      //             parentId: null,
      //             context: "33333",
      //             contextStandard: "44444",
      //             risk: "2",
      //             level: 2,
      //             result: true,
      //             desc: "描述6666",
      //             sort: 1,
      //             createTime: "2021-10-22 09:50:57",
      //             createBy: "krzhoujun",
      //             createByName: "周俊",
      //             updateBy: "krzhoujun",
      //             updateByName: "周俊",
      //             updateTime: "2021-10-22 09:50:57",
      //             itemParams: []
      //           }
      //         ],
      //         formWorkers: []
      //       }
      //     ],
      //     instructions: [],
      //     executes: null
      //   }
      // ];
    },
    changeTableData(data) {
      data.map(i => {
        i.editable = true;
      });
    },
    //新增作业表单
    addWorkList(data, hadData) {
      let rowIndex = this.workListData.rowIndex;
      data.rowIndex = hadData.length + 1;
      // data.partSource = "spare_part";
      data.action = "删除";
      hadData.push(data);
      this.$refs.workListTable.setTableData(hadData);
    },
    handleDelete() {},
    inputChange(val, item) {},
    //获取各作业表单的作业准备数据
    async getWorkListData(index, formIndex) {
      let workListData = await this.$refs[
        "workListTable_" + index + "_" + formIndex
      ][0].getTableData();
      workListData.map((i, index) => {
        delete i.action;
        i.sort = index;
      });
      return workListData;
    },
    //获取各作业表单的作业过程数据
    async getworkProcessData(index, formIndex) {
      let workProcessData = await this.$refs[
        "workProcessTable_" + index + "_" + formIndex
      ][0].getTableData();
      workProcessData.map((i, index) => {
        delete i.isChange;
        delete i.type;
        i.sort = index;
      });
      return workProcessData;
    },
    //获取各专业的表单数据
    async getFormData(data, index, formIndex) {
      data.overhaulReadies =
        (await this.getWorkListData(index, formIndex)) || [];
      data.itemDTOs = (await this.getworkProcessData(index, formIndex)) || [];
      return data;
    },
    //获取各专业的数据
    async getMajorData(data, index) {
      let formArr = [];
      for (let i = 0; i < data.forms.length; i++) {
        let formData = await this.getFormData(data.forms[i], index, i);
        formArr.push(formData);
      }
      data.instructions; //作业指导书
      data.forms = formArr;
      return data;
    },
    //获取整个作业表单的数据
    async getAllWorkListData() {
      let allArr = [];
      for (let i = 0; i < this.formData.length; i++) {
        let data = await this.getMajorData(this.formData[i], i);
        allArr.push(data);
      }
      return allArr;
    },
    //选择设备
    selectWorkStandard() {},
    //选择标准
    selectStandard() {
      let data = this.$refs.standardRelatedPage.getselectData();
      this.currentRow.standardName = data.name;
      this.currentRow.standardId = data.id;
      this.showStandard = false;
    },
    //选择作业知道书
    selectBook() {
      let data = this.$refs.bookList.getTableSelectData();
      let arr = [];
      data.map((i, index) => {
        let obj = {
          bussinessId: this.formData.id,
          instructionId: i.id,
          instructionName: i.name,
          orderType: "overhaul",
          sort: index
        };
        arr.push(obj);
      });
      this.formData.majors[this.tabActive].instructions = arr;
      this.showBookDialog = false;
    },
    chooseBook() {
      this.showBookDialog = true;
    },
    /* 获取作业指导书 */
    getBookFile(item, typ) {
      let form = {
        businessId: item.instructionId
      };
      getAttachList(form).then(res => {
        let data = res.data[0];
        if (res.data.length) {
          if (type == "preview") {
            this.preBook(data);
          } else if (type == "download") {
            this.downloadBook(data);
          }
        }
      });
    },

    //预览指导书
    preBook(item) {
      window.open(
        process.env.VUE_APP_BASEURL +
          "/eam-common-web/attachment/preview/?fileId=" +
          item.id
      );
      return true;
    },
    //下载指导书
    downloadBook(item) {
      this.$utils.downloadFile(item.id, item.name, item.path);
    },
    //删除指导书
    deletBook(nookItem, item, index) {
      let list = this.formData.majors[index].instructions;
      let arr = [];
      list.map(i => {
        if (i.id != nookItem.id) {
          arr.push(i);
        }
      });
      this.formData.majors[index].instructions = arr;
    },
    //删除表格的数据
    async deletRow(row, num) {
      let { collapseActive: formIndex, index } = this.currentMajor;
      let listArr = [];
      //获取当前作业准备的表格信息，不进行校验
      let workListData = await this.$refs["workListTable_" + index + "_" + formIndex][0].getTableData(false);
      workListData.map((i, index) => {
        if (index != num) {
          i.editable = true;
          listArr.push(i);
        }
      });
      this.$refs["workListTable_" + index + "_" + formIndex][0].setTableData(listArr);
    },
    /* 添加作业表单 */
    addWorlkForm(index) {
      //获取一遍所有表单的值
      let data = this.formData[index].forms;
      let form = {
        name: "",
        itemDTOs: [],
        overhaulReadies: []
      };
      data.push(form);
    },
    /* 移除 */
    removeItem(item, num, index) {
      //获取一遍所有表单的值，对这个值进行遍历
      let arr = [];
      let data = this.formData[index].forms;
      data.map((i, index) => {
        if (index != num) {
          arr.push(i);
        }
      });
      this.formData[index].forms = arr;
    },
    /* 上下移动 */
    moveItem(item, num, index, type) {
      //获取一遍所有表单的值，对这个值进行遍历
      let data = this.formData[index].forms;
      let arr = [];
      let onForm = {};
      let last = type == "up" ? num : num + 1; //要交换的两条数据的后一条数据的位置
      data.map((i, index) => {
        if (index == last - 1) {
          //跟接下来的那一条数据交换位置
          i.sort++;
          onForm = i;
        } else if (index == last) {
          i.sort--;
          arr.push(i);
          arr.push(onForm);
        } else {
          arr.push(i);
        }
      });
      this.formData[index].forms = arr;
    },
    getmajorName(val) {
      return this.$store.getters["fineDirtDataName"]("common_major", val);
    },
    showBookList(item) {
      let bookList = item.instructions || [];
      return bookList.length > 0;
    },
    handleChange(val, item) {
      this.currentMajor = item;
    },
    //tab页的切换
    tabClick(tab, event) {
      this.currentMajor = this.formData[this.tabActive];
    }
  }
};
</script>
<style lang="less">
.overhaul-workList {
  .el-collapse-item__header:before {
    background-color: rgba(255, 255, 255, 0);
  }
  .el-collapse-item__header.is-active {
    border-bottom: 1px solid @kr-border-sub-color;
  }
  .el-collapse-item__header {
    width: 100%;
    // border-bottom: 1px solid @kr-border-sub-color;
    // border-radius: @kr-border-radius;
    background-color: rgba(255, 255, 255, 0);
    height: 40px;
    line-height: 40px;
    font-weight: normal;
  }
  .el-collapse-item__content {
    padding: 0px 10px;
  }
  .el-collapse-item + .el-collapse-item {
    // border-top: none;
    margin-top: 10px;
  }
  .el-collapse-item {
    border: 1px solid @kr-border-sub-color;
    border-radius: 5px;
  }

  .el-collapse-item__header .el-icon-arrow-right {
    display: none;
  }
  .collapseLeft {
    position: absolute;
    display: flex;
    flex-flow: wrap nowrap;
    left: 10px;
  }
  .collapseRight {
    position: absolute;
    right: 10px;
  }
  .collapseTitle {
    width: 100%;
    height: 40px;
    position: relative;
  }
  .tableConten {
    display: flex;
    flex-flow: wrap nowrap;
    margin-top: 10px;
    .redPoint {
      color: red;
    }
    .itemTitle {
      width: 120px;
    }
    .tebleDiv {
      width: 100%;
      text-align: left;
      .tebleDiv {
        width: calc(100% - 120px);
      }
    }
    .tebleDiv-bottom {
      margin-top: 10px;
    }
  }
  .bookContent {
    width: 400px;
    border: 1px solid #ebebeb;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
  }
  .line {
    height: 30px;
    width: 100%;
    border: 1px dashed #ebebeb;
    padding: 0px 10px;
    display: flex;
    flex-flow: wrap nowrap;
    justify-content: space-between;
  }
  .line + .line {
    margin-top: 10px;
  }
}
.formName {
  .el-input__inner {
    border: none;
    height: 35px;
    line-height: 35px;
    padding: 0px 5px;
  }
}
</style>